'use strict';

const url = require('url');
const BaseController = require('./base');

class TestController extends BaseController {
  async index() {
    const { app, ctx, service } = this;
    const query = ctx.request.query;
    console.log('env:%j', app.config.env);
    const res = 0;
    const data = {
      env: app.config.env,
    };

    let baseUrl = 'http://sg-face.oss-cn-beijing.aliyuncs.com/images/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20200827192148.jpg';
    let path = 'xm-pic/test.png';
    let urlObj = url.parse(baseUrl);
    baseUrl = urlObj.host + "://" + urlObj.host
    console.log('urlArr:%j', urlObj);
    this.sendSuccess(data, 'ok');
  }
}

module.exports = TestController;
